﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using FwProject.Comm.ExcelUtil;
using FwProject.Core.Restaurant;
using FwProject.Core.TypeNumber;

namespace FwProject.Restaurant.Dto
{
    [DisplayName(displayName: "装车单")]
    public class LoadCarExportDto
    {
        [DisplayName(displayName: "装车单号")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public string CreationNumber { get; set; }

        [DisplayName(displayName: "状态")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public ExamineStatus ExamineStatus { get; set; } = ExamineStatus.未审核;

        [DisplayName(displayName: "装车时间")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public DateTime CreationTime { get; set; }

        [DisplayName(displayName: "司机")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public string DriverName { get; set; }

        [DisplayName(displayName: "车牌号")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public string PlatesNumber { get; set; }

        [DisplayName(displayName: "装车状态")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = true)]
        public CarStatus CarStatus { get; set; } = CarStatus.出库审核中;

        [ExcelDateMember(IsMultiRow = true, IsMerged = false,IsClass =true,ListOne =false)]
        public List<LoadCarDetailsModel> loadCarDetailsList { get; set; }
    }

    public class LoadCarDetailsModel
    {
        [DisplayName(displayName: "装车型号")]
        [ExcelDateMember(IsMultiRow = true, IsMerged = false)]
        public string TypeNumberName { get; set; }

        [DisplayName(displayName: "装车数")]
        [ExcelDateMember(IsMultiRow = true, IsMerged = false,IsSum =true)]
        public int Countproduct { get; set; }

        [DisplayName(displayName: "单位")]
        [ExcelDateMember(IsMultiRow = true, IsMerged = false)]
        public UnitFlag Unit { get; set; } = UnitFlag.箱;
    }
}
